package top.kaoshanji.q1ch07a;

import top.kaoshanji.y1constant.FileConstant;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * 代码清单-q1ch07a-330页a：测试文件是否结束
 * 输出全都是数字..然后，数字根据字符集对应字符？？是这样吗？
 * author kaoshanji
 * ^_^
 * create time 2025/3/12 15:36
 */
public class TestEOF {

    static String pathStr = FileConstant.LOCAL_ROOT_PATH.concat("q1ch07a330页a\\");

    public static void main(String[] args) {

        try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(pathStr.concat("TestEOF.java"))))) {

            while (in.available() != 0) {
                System.out.println(in.readByte());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }


}
